var e = i(require("@vant/weapp/toast/toast")), t = i(require("@vant/weapp/dialog/dialog"));

function i(e) {
    return e && e.__esModule ? e : {
        default: e
    };
}

var a = getApp(), o = require("../../utils/config"), s = require("../../utils/question");

Page({
    data: {
        image: o.resourceRoot + "pdf.png",
        themeColor: a.globalData.themeColor,
        filePath: "",
        stid: "",
        name: "",
        size: "",
        reportid: "",
        showedsatisfactionquestion: !1
    },
    onLoad: function(e) {
        this.setData({
            filePath: e.filePath,
            stid: e.stid,
            size: e.size,
            name: e.name,
            reportid: e.reportid,
            showedsatisfactionquestion: e.showedsatisfactionquestion
        });
        var i = e.stid.split("-")[0];
        console.log("填写问卷体检号", i), s.generateQuestionUrl(i).then(function(e) {
            console.log("生成的问卷链接", e), null != e && null != e && "" != e && t.default.confirm({
                title: "提示",
                message: "是否去填写满意度问卷？"
            }).then(function() {
                wx.navigateTo({
                    url: "/pages/webview/webview?isTimestamp=0&h5=".concat(encodeURIComponent(e)),
                    success: function() {}
                });
            }).catch(function() {});
        });
    },
    viewReport: function() {
        "" == this.data.filePath && (0, e.default)({
            message: "请先下载报告",
            duration: 5e3
        }), wx.openDocument({
            filePath: this.data.filePath,
            showMenu: !0,
            success: function(e) {
                console.log(e);
            }
        });
    },
    shareReport: function() {
        "" == this.data.filePath && (0, e.default)({
            message: "请先下载报告",
            duration: 5e3
        }), wx.shareFileMessage({
            filePath: this.data.filePath,
            success: function() {},
            fail: console.error
        });
    }
});